package com.qingfeng.client.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qingfeng.client.bean.Attr;
import com.qingfeng.client.bean.GoodsType;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author zhangyuefei
 * @version 1.0
 * @date 2020/1/6 10:16 上午
 */
public interface GoodsTypeMapper extends BaseMapper<GoodsType> {
    List<GoodsType> getStoreTypes(@Param("storeId")Long storeId);
    List<Map<String,Object>> queryByParentId(@Param("parentId")Integer parentId);

    List<GoodsType> selectAllByLevel(@Param("level")Integer level);


    List<GoodsType> selectByLevel();
    //在good_type中获取最大的id
    int selectMax(@Param("name")String name);

    boolean insertFuLei(@Param("typeName")String name,@Param("commonSort") int max,
                        @Param("storeId") int storeId,@Param("icon")String icon);

    boolean insertZiLei(@Param("typeName")String name,@Param("commonSort") int max,
                        @Param("parentId")int Max,@Param("storeId") int storeId,@Param("icon")String icon);

    List<Attr> selectAttr();

    boolean updates(@Param("name")String name, @Param("id")int id);

    int selectParentId(@Param("id")Integer id);

    boolean update2(@Param("name")String name,@Param("parentId") int parentId);

    boolean updateSql(String sql);

    boolean updateSqls(String sqls);

    List<Map<String, Object>> get();

    int selectMaxs();

    int selects(int id);
}
